home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mintmant / dreaddir.txt < prev    next >
Text File  |  1992-03-24  |  2KB  |  64 lines

  1. Dreaddir(2)               Oct. 1, 1991                Dreaddir(2)
  2.  
  3.  
  4.  
  5. NAME
  6.      Dreaddir - read directory information
  7.  
  8. SYNOPSIS
  9.      LONG Dreaddir( WORD len, LONG dirhandle, char *buf);
  10.  
  11. DESCRIPTION
  12.      readdir returns the next file in the directory whose  handle
  13.      (from  the  Dopendir  system call) is dirhandle.  The file's
  14.      name and (optionally) a 4 byte index for the file are placed
  15.      in  the buffer pointed to by buf.  The file index is omitted
  16.      if the directory was opened  in  "compatibility"  mode  (see
  17.      Dopendir(2)  for  details); otherwise, it is placed first in
  18.      the buffer, followed by the (null terminated) name.  If  two
  19.      names have the same index, then they refer to the same file;
  20.      the converse, however, is not true.
  21.  
  22.      len is the size of the buffer, in total; it should be  large
  23.      enough  to  hold  the index (if any), the file name, and the
  24.      trailing 0.
  25.  
  26.      Successive calls to Dreaddir will return all  the  names  in
  27.      the directory, one after another, unless the Drewinddir sys-
  28.      tem call is used to restart the reading at the beginning  of
  29.      the directory.
  30.  
  31. RETURNS
  32.      0 if successful
  33.  
  34.      ERANGE if the buffer was not large enough to hold the  index
  35.      (if present) and name
  36.  
  37.      ENMFIL if there are no more file names to be read  from  the
  38.      directory
  39.  
  40. SEE ALSO
  41.      Dclosedir(2), Dopendir(2), Drewinddir(2)
  42.  
  43. BUGS
  44.      Failure to call Dclosedir() when the search  is  done  could
  45.      result in the system eventually running out of file indices;
  46.      this is fatal.  So always call Dclosedir() when you're  fin-
  47.      ished with the directory search!
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Version 0.9   Last change: MiNT Programmer's Manual             1
  61.  
  62.  
  63.  
  64.